<?php
namespace App\Controllers\Collect;
use App\Models\Collect\Collect;
/**
*	获取收藏信息
*/
class GetCollect extends \App\Libs\Base\BaseAction
{
	protected function beforeRun() {
         parent::beforeRun();
         $this->needLogin = TRUE;
    }
	
	public function execute() {
		//获取图片
		$type = $this->request->get( 'type' );
		if( empty( $type ) ){
			return \App\Libs\Views\Json::view(1, '缺少相关参数', '');	
		}
		
		$info = Collect::getCollectInfo( $this->session->user->id , $type );
		
		//系统错误
		if (!$info) {
			return \App\Libs\Views\Json::view( 0 , '获取收藏信息', []);
		}
		
		//返回成功数据
		return \App\Libs\Views\Json::view( 0 , '获取收藏成功', $info);
	}
}
